<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    for (var a = 0; a < 8; a++) {

        for (var c = 8; c >= a; c--) {
            document.write('&ensp;')
        }
        for (var b = 1; b <= a * 2 - 1; b++) {
            document.write('*')
        }

        document.write('<br>')

    }
</script>

</html>